1. Technical Field
The disclosed embodiments relate to the Universal Serial Bus (USB).
2. Background Information
A serial bus known as the Universal Serial Bus, or USB bus, is commonly used to connect devices to a computer. A device functions as a slave on the USB bus. The device includes pullup resistors for pulling up on the pair of data conductors in the USB bus cable. The computer is called the host. The host functions as the master on the USB bus. When the device is first coupled to the computer via the USB cable, the pullup resistors of the device pull up on the data conductors in the cable. The host detects this and responds by writing a value into a predetermined memory location on the device via the USB bus. This predetermined location is called a control endpoint and is normally referred to as “endpoint 0”. The writing into the control endpoint is called a request.
The device responds to this request by providing information to the host that indicates what kind of device was just connected to the bus and what resources the device will require. For example, the host issues one or more different requests to the device and reads across the USB bus a requested device descriptor, a requested configuration descriptor, a requested interface descriptor, and a requested endpoint descriptor. The descriptors are data structures defined by the USB specification to be formatted to contain particular information. From information in these descriptors obtained from the device, the host determines the type of device driver needed and loads an appropriate device driver. This device driver is normally called a USB function driver. Thereafter communication occurs between the device and the driver across what are referred to as pipes. A pipe is a logical connection between an endpoint on the device and the driver in the host. The host can write to or read from an endpoint by specifying the endpoint in a four bit field in a packet sent out on the USB from the host. Due to the four bit field, there can be at most sixteen pairs of endpoints in the device. Accordingly, there can be at most 32 active pipes, 16 into the host and 16 out from the host.
USB devices are becoming ever more complex. A physical device such as a cellular telephone may actually contain a plurality of different logical USB devices. For example, the cellular telephone may appear from the host's perspective to contain a secure wireless modem, a second wireless modem that is not secure but is suitable for internet surfing, a GPS (Global Positioning System) device, and a removable storage drive. The secure wireless modem is suitable for engaging in secure networking communications. The second wireless modem is suitable for internet surfing. The GPS device sends periodic location information to the host. The storage device provides a place where the host can store information and from which the host can retrieve information. These different logical USB devices that are all embodied in the physical cellular telephone are referred to as “logical devices”.
Consider one such logical device. If, for example, the logical device has information for the host to read, then the logical device interrupts the host. The USB bus, however, is a host centric bus. Only the host initiates transactions and only the host can read and/or write information across the USB bus cable. The host therefore periodically performs a read across the USB bus of an interrupt endpoint associated with the device. This is called “polling”. When the device wishes to interrupt the host, the device places into the interrupt endpoint information indicating the interrupt condition. The host therefore learns of the interrupt condition by reading the interrupt endpoint (via the USB bus) during a polling operation. If the information read indicates further reads are needed, then the host responds by performing another read across the USB bus of another endpoint associated with the logical device. In the case of the logical device being the secure wireless modem, encrypted key information may be read by the host from the other endpoint associated by the secure wireless modem.
As USB devices get more and more complex and embody more and more logical devices having more and more functions, it may be that more than the available thirty-two endpoints are required to support the functions of the USB devices. One possible solution is to break the USB functions into multiple sets and to keep only one set of functions active at a time. This is possible under the USB standard. This would allow endpoints to be used for one logical device at a first time when one set of logical devices are active, and to be used for a second logical device at a second time when a second set of logical devices are active. Having logical devices disabled at certain times is, however, undesirable. The user may need to terminate current operations in order to switch to another logical device. Switching to another logical device may also trigger a new device enumeration, causing some of the user's jobs to be terminated. The result would be inefficiency and inconvenience.
A second solution is to provide another physical USB port and its associated USB functionality on the physical USB device. Each physical port and its associated functionality can support a full sixteen pairs of endpoints. This solution is costly due having to provide multiple instances of hardware. Moreover, the additional physical USB port on the physical USB device may cause confusion for users because it may not be known which logical devices are supported on which physical USB port. Moreover, USB device software may be complicated due to the need to handle multiple USB ports simultaneously.
A solution is desired.